<template>
  <div>
    <HETTable1 ref="hetTable" :config="tableConfig" />
  </div>
</template>

<script setup>
import {ref} from "vue"
import { mAxios, encodeURL } from "~/utils/axios/axios.js";
const tableConfig = ref({
  selectApi: (params) => mAxios.get(`bookmarks/list`, { params }),
  search: {
    form: {},
    config: [
      {
        label: "关键字",
        prop: "keywords",
        type: "input",
        setting: { placeholder: "请输入关键字搜索" },
      },
    ],
  },
  columns: [
    { type: "selection", width: 34 },
    { label: "书签名称", prop: "title" },
    { label: "收藏者", prop: "username" },
    { label: "网址", prop: "url" },
    { label: "描述", prop: "description" },
    
    { label: "收藏时间", prop: "createdAt" },
    {
      label: "操作",
      // width: 400,
      custom: {
        type: "button",
        operatBtns: [
          {
            name: "编辑",
            handleClick: (row) => {
              
            },
          },
          {
            name: "删除",
            type: "delete",
            disabledFn: (row) => {
              return row.enable == false;
            },
          },
        ],
      },
    },
  ],
  controlBtns: [
    {
      name: "新增",
      icon: "Plus",
      type: "primary",
      handleClick: () => {
        router.push({
          name: "ReportTemplate",
        });
      },
    },
    {
      name: "批量删除",
      icon: "Delete",
      type: "delete",
      disabled: (data) => {
        return data.length == 0;
      },
    },
  ],
});

</script>